<?php 
picture_category::$_lang = $this->user->getLang();
if(!function_exists('_categoryTree')) {
	function _categoryTree($obj, $tree) {
		$str = "";
		foreach((array) $tree AS $row) {
			$url = $obj->url('picture/special/list', array(), array('category_id' => $row['id']));
			$str .= '<ul class="sub">';
			$str .= '<li><a href="' . $url . '">' . htmlspecialchars($row['title']) . '[<em class="red">' . $row['stotal'] . '</em>]</a>';
			if(!empty($row['children'])) {
				$str .= _categoryTree($obj, $row['children']);
			}
			$str .= '</li></ul>';
		}
		return $str;
	}
}
?>
<div id="mainDiv">
	<div id="tree">
		<div id="treeData">			
			<h1><?php echo $this->language('Picture');?></h1>
			<hr/>
			<div class="item">
				<ul>
					<li>
						<a href="<?php echo $this->url('picture/photo/index');?>"><?php echo $this->language('Photo List');?></a>
						<?php echo _categoryTree($this, picture_category::allCategoryToTreeAsArray());?>
					</li>
					<li><a href="<?php echo $this->url('picture/category/index');?>"><?php echo $this->language('Category Manage');?></a></li>
					<li><a href="<?php echo $this->url('picture/special/index');?>"><?php echo $this->language('Special Manage');?></a></li>
				</ul>
			</div>
		</div>
	</div>
	<div id="switch"><a class="switch">Switch</a></div>
	<div id="frame"><iframe src="<?php echo $this->url('picture/index');?>" id="mainFrame" name="mainFrame"></iframe></div>
</div>
	

